﻿using OptimizationDemo.Optimization.Configuration.BundleConfiguration;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Xml;
using System.Xml.Serialization;

namespace OptimizationDemo.Optimization.Configuration
{
    public class Deserializer
    {
        public static string path = "\\Optimization\\Configuration\\BundleConfiguration.xml";

        public static Bundles Serializer()
        {
            XmlSerializer serializer = new XmlSerializer(typeof(Bundles));
            XmlDocument xmlDocument = new XmlDocument();
            var path2 = string.Concat(AppDomain.CurrentDomain.BaseDirectory, path);
            xmlDocument.Load(path2);
            var result = serializer.Deserialize(new MemoryStream(Encoding.UTF8.GetBytes(xmlDocument.OuterXml))) as Bundles;
            return result;
        }
    }
}